#: import environ os.environ
#: import FortnightlyToolbar libs.baseclass.toolbar.FortnightlyToolbar
#: import StiffScrollEffect kivymd.effects.stiffscroll.StiffScrollEffect


<FortnightlyRootScreen>

    MDBoxLayout:
        orientation: 'vertical'

        FortnightlyToolbar:

        ScrollView:
            effect_cls: StiffScrollEffect

            MDList:

                HeadlineNews:

                FortnightlyListItem:
                    title: "TECH"
                    secondary_text: "The Future of Petrol"
                    image: f"{environ['FORTNIGHTLY_ROOT']}/assets/images/gas.png"

                FortnightlyListItem:
                    title: "POLITICS"
                    secondary_text: "Divided American Lives During War"
                    image: f"{environ['FORTNIGHTLY_ROOT']}/assets/images/war.png"

                MDList:
                    padding: dp(20)
                    FortnightlyLabel:
                        text: "Latest updates"
                        font_style: "Caption"

                FortnightlyListItem:
                    title: "POLITICS"
                    secondary_text: "Reforming The Green Army from Within"
                    image: f"{environ['FORTNIGHTLY_ROOT']}/assets/images/army.png"

                FortnightlyListItem:
                    title: "WORLD"
                    secondary_text: "As Stocks Stagnate, many Look to Currency"
                    image: f"{environ['FORTNIGHTLY_ROOT']}/assets/images/stocks.png"

                FortnightlyListItem:
                    title: "TECH"
                    secondary_text: "Designers use Tech to make Futuristic Fabrics"
                    image: f"{environ['FORTNIGHTLY_ROOT']}/assets/images/fabrics.png"


<HeadlineNews@MDBoxLayout>
    orientation: 'vertical'
    spacing: dp(10)
    adaptive_height: True

    FitImage:
        source: f"{environ['FORTNIGHTLY_ROOT']}/assets/images/healthcare.jpg"
        size_hint: (1, None)
        height: dp(200)
        pos_hint: {'center_x': .5}

    MDList:
        spacing: dp(15)
        padding: dp(20)

        FortnightlyLabel:
            text: "WORLD"
            font_style: "Button"

        FortnightlyLabel:
            text: "The Quiet, yet Powerful Healthcare Revolution"
            font_style: "H5"


<FortnightlyListItem>
    size_hint_y: None
    height: dp(100)

    canvas:
        Color:
            rgba:
                self.theme_cls.divider_color
        Line:
            points: (root.x+dp(16), root.y, root.x+self.width-dp(16)-0, root.y)

    MDBoxLayout:
        orientation: 'vertical'
        adaptive_height: True
        pos_hint: {"center_x": .5, "center_y": .5}
        padding: dp(15)
        spacing: dp(10)

        FortnightlyLabel:
            text: root.title
            font_style: "Button"

        FortnightlyLabel:
            text: root.secondary_text
            font_style: "Subtitle1"

    MDBoxLayout:
        adaptive_size: True
        pos_hint: {"center_x": .5, "center_y": .5}

        Image:
            source: root.image
            size_hint: (None, None)


<FortnightlyLabel@MDLabel>
    adaptive_height: True
